/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tk.eigh.ksvg.component.filter;

import ksvg.core.SVGFilter;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
import tk.eigh.ksvg.types.SVGNumber;

/**
 * <p>This filter primitive lights a source graphic using the alpha channel as a
 * bump map. The resulting image is an RGBA image based on the light color. The
 * lighting calculation follows the standard specular component of the Phong
 * lighting model. The resulting image depends on the light color, light
 * position and surface geometry of the input bump map. The result of the
 * lighting calculation is added. The filter primitive assumes that the viewer
 * is at infinity in the z direction (i.e., the unit vector in the eye direction
 * is (0,0,1) everywhere).</p> <p>This filter primitive produces an image which
 * contains the specular reflection part of the lighting calculation. Such a map
 * is intended to be combined with a texture using the <em>add</em> term of the
 * <em>arithmetic</em> <a
 * href="http://www.w3.org/TR/SVG/filters.html#feCompositeElement">‘feComposite’</a>
 * method. Multiple light sources can be simulated by adding several of these
 * light maps before applying it to the texture image.</p> <p>The resulting RGBA
 * image is computed as follows:</p> <p>S<sub>r</sub> = k<sub>s</sub> * pow(N.H,
 * specularExponent) * L<sub>r<br/> </sub> S<sub>g</sub> = k<sub>s</sub> *
 * pow(N.H, specularExponent) * L<sub>g<br/> </sub> S<sub>b</sub> =
 * k<sub>s</sub> * pow(N.H, specularExponent) * L<sub>b<br/> </sub>
 * S<sub>a</sub> = max(S<sub>r,</sub> S<sub>g,</sub> S<sub>b</sub>)</p>
 * <p>where</p> <dl><dd>k<sub>s</sub> = specular lighting constant<br/> N =
 * surface normal unit vector, a function of x and y<br/> H = "halfway" unit
 * vector between eye unit vector and light unit vector<br/> <br/>
 * L<sub>r</sub>,L<sub>g</sub>,L<sub>b</sub> = RGB components of light</dd></dl>
 * <p>See <a
 * href="http://www.w3.org/TR/SVG/filters.html#feDiffuseLightingElement">‘feDiffuseLighting’</a>
 * for definition of N and (L<sub>r</sub>, L<sub>g</sub>, L<sub>b</sub>).</p>
 * <p>The definition of H reflects our assumption of the constant eye vector E =
 * (0,0,1):</p> <p >H = (L + E) / Norm(L+E)</p> <p>where L is the light unit
 * vector.</p> <p>Unlike the <a
 * href="http://www.w3.org/TR/SVG/filters.html#feDiffuseLightingElement">‘feDiffuseLighting’</a>,
 * the <a
 * href="http://www.w3.org/TR/SVG/filters.html#feSpecularLightingElement">‘feSpecularLighting’</a>
 * filter produces a non-opaque image. This is due to the fact that the specular
 * result (S<sub>r</sub>,S<sub>g</sub>,S<sub>b</sub>,S<sub>a</sub>) is meant to
 * be added to the textured image. The alpha channel of the result is the max of
 * the color components, so that where the specular light is zero, no additional
 * coverage is added to the image and a fully white highlight will add
 * opacity.</p> <p>The <a
 * href="http://www.w3.org/TR/SVG/filters.html#feDiffuseLightingElement">‘feDiffuseLighting’</a>
 * and <a
 * href="http://www.w3.org/TR/SVG/filters.html#feSpecularLightingElement">‘feSpecularLighting’</a>
 * filters will often be applied together. An implementation may detect this and
 * calculate both maps in one pass, instead of two.</p>
 */
@JSFComponent(name = "svg:SpecularLighting",
type = "tk.eigh.svg.SpecularLighting",
family = "filter.SpecularLighting",
clazz = "ksvg.filter.SpecularLighting",
tagClass = "ksvg.tags.filter.SpecularLightingTag",
defaultRendererType = "filter.SVGSpecularLightingRenderer")
public abstract class AbstractSpecularLighting extends SVGFilter implements _LightingColorAware {

    /**
     * surfaceScale = "<em><a
     * href="http://www.w3.org/TR/SVG/types.html#DataTypeNumber">&lt;number&gt;</a></em>"<br/>height
     * of surface when A<sub>in</sub> = 1.<br/> If the attribute is not
     * specified, then the effect is as if a value of 1 were specified.<br/> <a
     * href="http://www.w3.org/TR/SVG/animate.html#Animatable">Animatable</a>:
     * yes.
     */
    @JSFProperty
    public abstract SVGNumber getSufaceScale();

    /**
     * specularConstant = "<em><a
     * href="http://www.w3.org/TR/SVG/types.html#DataTypeNumber">&lt;number&gt;</a></em>"<br/>ks
     * in Phong lighting model. In SVG, this can be any non-negative
     * number.<br/> If the attribute is not specified, then the effect is as if
     * a value of 1 were specified.<br/> <a
     * href="http://www.w3.org/TR/SVG/animate.html#Animatable">Animatable</a>:
     * yes.
     */
    @JSFProperty
    public abstract SVGNumber getSufaceConstant();

    /**
     * specularExponent = "<em><a
     * href="http://www.w3.org/TR/SVG/types.html#DataTypeNumber">&lt;number&gt;</a></em>"<br/>Exponent
     * for specular term, larger is more "shiny". Range 1.0 to 128.0.<br/> If
     * the attribute is not specified, then the effect is as if a value of 1
     * were specified.<br/> <a
     * href="http://www.w3.org/TR/SVG/animate.html#Animatable">Animatable</a>:
     * yes.
     */
    @JSFProperty
    public abstract SVGNumber getSpecularExponent();

    /**
     * kernelUnitLength = "<a
     * href="http://www.w3.org/TR/SVG/types.html#DataTypeNumberOptionalNumber">&lt;number-optional-number&gt;</a>"<br/>The
     * first number is the &lt;dx&gt; value. The second number is the &lt;dy&gt;
     * value. If the &lt;dy&gt; value is not specified, it defaults to the same
     * value as &lt;dx&gt;. Indicates the intended distance in current filter
     * units (i.e., units as determined by the value of attribute <a
     * href="http://www.w3.org/TR/SVG/filters.html#FilterElementPrimitiveUnitsAttribute">‘primitiveUnits’</a>)
     * for
     * <code>dx</code> and
     * <code>dy</code>, respectively, in the <a
     * href="http://www.w3.org/TR/SVG/filters.html#SurfaceNormalCalculations">surface
     * normal calculation formulas</a>. By specifying value(s) for <a
     * href="http://www.w3.org/TR/SVG/filters.html#feSpecularLightingKernelUnitLengthAttribute">‘kernelUnitLength’</a>,
     * the kernel becomes defined in a scalable, abstract coordinate system. If
     * <a
     * href="http://www.w3.org/TR/SVG/filters.html#feSpecularLightingKernelUnitLengthAttribute">‘kernelUnitLength’</a>
     * is not specified, the
     * <code>dx</code> and
     * <code>dy</code> values should represent very small deltas relative to a
     * given
     * <code>(x,y)</code> position, which might be implemented in some cases as
     * one pixel in the intermediate image offscreen bitmap, which is a
     * pixel-based coordinate system, and thus potentially not scalable. For
     * some level of consistency across display media and user agents, it is
     * necessary that a value be provided for at least one of <a
     * href="http://www.w3.org/TR/SVG/filters.html#FilterElementFilterResAttribute">‘filterRes’</a>
     * and <a
     * href="http://www.w3.org/TR/SVG/filters.html#feSpecularLightingKernelUnitLengthAttribute">‘kernelUnitLength’</a>.
     * Discussion of intermediate images are in the <a
     * href="http://www.w3.org/TR/SVG/filters.html#Introduction">Introduction</a>
     * and in the description of attribute <a
     * href="http://www.w3.org/TR/SVG/filters.html#FilterElementFilterResAttribute">‘filterRes’</a>.<br/>
     * A negative or zero value is an error (see <a
     * href="http://www.w3.org/TR/SVG/implnote.html#ErrorProcessing">Error
     * processing</a>).<br/> <a
     * href="http://www.w3.org/TR/SVG/animate.html#Animatable">Animatable</a>:
     * yes.
     */
    @JSFProperty
    public abstract String getKernelUnitLength();
}